package com.health.userbackstage.service.relationservice.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.health.userbackstage.mapper.relationmapper.SetMealCheckGroupMapper;
import com.health.userbackstage.pojo.relation.SetMealCheckGroup;
import com.health.userbackstage.service.relationservice.SetMealCheckGroupService;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author ASUS
 * @Date 2023/8/18 21:19
 * @Version 1.0
 */
@Service
public class SetMealCheckGroupServiceImpl extends ServiceImpl<SetMealCheckGroupMapper, SetMealCheckGroup> implements SetMealCheckGroupService {

    @Autowired
    private SetMealCheckGroupMapper scgm;

    @Override
    public void delBySetMealId(Integer setMealId) {
        scgm.delBySetMealId(setMealId);
    }

    @Override
    public void del(Integer setMealId, Integer checkGroupId) {
        scgm.del(setMealId,checkGroupId);
    }

    @Override
    public void add(Integer setMealId, Integer checkGroupId) {
        scgm.add(setMealId,checkGroupId);
    }

    @Override
    public void add(Integer setMealId, List<Integer> checkGroupIds) {
        for (Integer checkGroupId:checkGroupIds) {
            scgm.add(setMealId,checkGroupId);
        }
    }
}
